<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>任务维护</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css" />
        <link rel="stylesheet" href="css/zTreeStyle/zTreeStyle.css" />
        <link rel="stylesheet" href="css/task-manage.css" />

    </head>

    <body>
        <div class="edit-task" ms-controller="mainController">
            <div class="header">
                <div ms-if="pageType==2" class="u-title">新增任务</div>
                <div ms-if="pageType==0" class="u-title">查看任务</div>
                <div ms-if="pageType==1" class="u-title">编辑任务</div>
            </div>
            <div class="u-multiform">
                <div class="column">
                    <div class="cell">
                        <label><span>*</span>任务类型：</label>
                        <div class="cnt-box radio-x">
                        	<!-- pageType 0:查看1：修改2：新增 -->
                            <div class="u-radio" ms-class="dis:pageType!=2">
                                <input name="taskType" type="radio" value="1" ms-duplex-string="taskType" ms-attr-disabled="pageType!=2" />
                                <span>盘点</span>
                            </div><!-- 删除簇盘点类型
                            <div class="u-radio" ms-class="dis:pageType!=2">
                                <input name="taskType" type="radio" value="2" ms-duplex-string="taskType" ms-attr-disabled="pageType!=2" ms-click="selCluster" />
                                <span>簇商品维护</span>
                            </div> -->
                        </div>
                    </div>
                    <div class="cell">
                        <label><span>*</span>库位：</label>
                        <div class="cnt-box radio-x">
                            <div class="u-radio" ms-class="dis:pageType==0">
                                <input name="storage" type="radio" value="0007" ms-duplex-string="storageVal" ms-attr-disabled="pageType==0" />
                                <span>样机库</span>
                            </div>
                            <div class="u-radio" ms-class="dis:pageType==0">
                                <input name="storage" type="radio" value="8000" ms-duplex-string="storageVal" ms-attr-disabled="pageType==0" />
                                <span>柜台库</span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column">
                    <div class="cell">
                        <label><span>*</span>下发门店：</label>
                        <div class="cnt-box store">
                            <button class="u-btn small" ms-click="storePop">{{pageType==0?"查看":"编辑"}}</button>
                            <span class="len">已选 {{storeList.length}}</span>
                        </div>
                    </div>
                    <div class="cell">
                        <label><span>*</span>任务时间：</label>
                        <div class="cnt-box">
                            <input class="u-ipt ipt-datepicker" ms-class="dis:pageType==0" readonly="readonly" type="text" id="starttime" ms-duplex="starttime" ms-attr-disabled="pageType==0"/>
                            <span class="split">-</span>
                            <input class="u-ipt ipt-datepicker" ms-class="dis:pageType==0" readonly="readonly" type="text" id="endtime" ms-duplex="endtime" ms-attr-disabled="pageType==0"/>
                        </div>
                    </div>
                </div>
                <div class="column">
                    <div class="cell long">
                        <label><span>*</span>任务范围：</label>
                        <div class="cnt-box">
                            <div class="u-radio" ms-class="dis:pageType==0">
                                <input type="checkbox" ms-click="selAllCategory()" ms-attr-disabled="pageType==0" id="allcategory">
                                <span ms-click="selAllCategory()">全品类品牌</span>
                            </div>
                            <div class="category-brand">
                                <div class="category">
                                    <div class="title">品类</div>
                                    <ul>
                                        <li class="active"  ms-repeat-category="allCategory" ms-class="sel:$index==0" ms-click="getBrand(category)">
                                            <label>{{category.categoryName}}</label>
                                            <span ms-attr-id="sel_{{category.categoryCode}}" style="display: none;">(已选)</span>
                                        </li>
                                    </ul>
                                </div>
                                <div class="brand">
                                    <div class="title">品牌</div>
                                    <div class="search">
                                        <input id="brandSearchName"class="u-ipt" ms-duplex="brandSearchName">
                                        <div class="find-icon" ms-click="brandSearch"></div>
                                    </div>
                                    <ul>
                                        <div class="u-radio" ms-class="dis:pageType==0">
                                            <input type="checkbox" ms-click="selAllBrand()" ms-attr-disabled="pageType==0" id="allbrand">
                                            <span ms-click="selAllBrand()">全品牌</span>
                                        </div>
                                        <li ms-repeat-brand="allBrandByCate" ms-click="addbrandSelList(brand)" ms-class="sel:brand.isSel" ms-attr-title="brand.brandName">
                                            {{brand.brandName | truncate(23,"...")}}
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="column">
                    <div class="cell">
                        <label></label>
                        <div class="cnt-box">
                            <button class="u-btn gray return" ms-click="returnManage()">返回</button>
                            <button ms-if="pageType!=0" class="u-btn save" ms-click="saveTask">保存</button>
                            <span class="err-box">请输入必填项</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div ms-controller="popController">
            <div class="u-popup" id="popup_cnt">
                <div class="bg"></div>
                <div class="asTable-box">
                    <div class="asTable">
                        <div class="asTableCell">
                            <div class="asCell dialog">
                                <p class="err-box">至少选择一个门店</p>
                                <a href="javascript:;" class="close btn-close">×</a>
                                <p class="title">选择门店</p>
                                <div class="container">
                                    <div class="form-normal">
                                        <div class="column clone-select">
                                            <label>维护目标：</label>
                                            <input ms-if="tToggle" class="clone-select dis" readonly="readonly" ms-attr-value="{{storeType==0?'服务站':'门店'}}" />
                                            <select ms-duplex="storeType" ms-change="callback" ms-attr-disabled="tToggle" ms-class="dis:tToggle">
                                                <option value="1">门店</option>
                                                <option value="0">服务站</option>
                                            </select>
                                        </div>
                                        <div class="column">
                                            <label>搜索目标：</label>
                                            <input class="u-ipt" type="text" ms-duplex="keyword" placeholder="请输入关键字" id="keywordId" />
                                        </div>
                                        <div class="column">
                                            <label></label>
                                            <button class="u-btn small" ms-click="search">查询</button>
                                        </div>
                                    </div>
                                    <div class="tree-box">
                                        <ul ms-if="storeType==1" id="storeTree" class="ztree"></ul>
                                        <ul ms-if="storeType==0" id="serviceTree" class="ztree"></ul>
                                        <div class="loadTree">
                                            <div class="la-ball-spin-clockwise-fade">
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                                <div></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="btn-box">
                                    <button class="u-btn" ms-click="saveNodes">确定</button>
                                    <button class="u-btn gray btn-close">取消</button>
                                    <!--<button class="u-btn gray btn-close" ms-click="cancelSelNode">取消</button>-->
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="error"></div>
                                <p></p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="loadData"></div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/jquery.ztree.all-3.5.min.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/edittask-property.js?v=20160902"></script>
    </body>

</html>